a = int(input())
ans = pow(2, a, 10**600) - 1
s = str(ans)
print(int(a * 30102999566398114 / 100000000000000000 + 1))
if len(s) <= 500:
    s = s.zfill(500)
else:
    s = s[len(s) - 500:]
for i in range(0, 500, 50):
    print(s[i:i+50])